package uk.ac.aber.paws.client.constants;

/**
 * @author Rob Johnson, Aberystwyth University
 * @email rob.johnson@aber.ac.uk
 * @date 16th August 2011
 * 
 * CommandConstants.java
 * 
 * Contains all constants containing o/s level commands
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

public class CommandConstants {

	 /**
     * The windows command to extract the system serial number from the system 
     */
    public static final String COMMAND_SERIAL_NUMBER = "cmd.exe /c c:\\windows\\system32\\wbem\\WMIC.exe bios get serialnumber";
    
    /**
     * The windows command to obtain the users logged into the system
     */
    public static final String COMMAND_LOGGED_IN_USER = "cmd.exe /c c:\\windows\\system32\\wbem\\WMIC.exe /Node:localhost ComputerSystem Get UserName";
    public static final String COMMAND_VOLUME_INFO = "cmd.exe /c c:\\windows\\system32\\wbem\\WMIC.exe /Node:localhost VOLUME Get DriveLetter,DriveType";
    public static final String COMMAND_MACIP_INFO = "cmd.exe /c c:\\windows\\system32\\wbem\\WMIC.exe nicconfig get macaddress,ipaddress <nul";
    
    public static final String COMMAND_LOGGED_IN_WINDOWS = "cmd.exe /c c:\\windows\\system32\\qwinsta.exe";
    public static final String COMMAND_WARNING_WINDOW = "javaw -classpath \"c:/program files/paws/lib/pawsclient.jar\" uk.ac.aber.paws.client.pendrivechecker.WarningWindow";
    public static final String COMMAND_CANCEL_SHUTDOWN = "cmd.exe /c shutdown -a";
    
    public static final String[] COMMAND_REBOOT = {"cmd.exe", "/c", "shutdown", "/r", "/t", "10"};
    
    public static final String[] COMMAND_RUN_PAWSPROGRAM_WINDOWS = {"cmd.exe", "/c", "start", "javaw", "-jar", ""};
    public static final String[] COMMAND_RUN_PAWSPROGRAM_MAC = {"/bin/sh", "-c", ""};
    public static final String[] COMMAND_RUN_PAWSPROGRAM_LINUX = {"/bin/sh", "-c", ""};
    
    
    /**
     * The windows command to turn off hibernate mode prior to a sleep
     */
    public static final String COMMAND_HIBERNATE_OFF = "cmd.exe /c powercfg -hibernate off";
    
    /**
     * The windows command to sleep the computer
     */
    public static final String COMMAND_SLEEP_COMPUTER_XP = "cmd.exe /c rundll32 powrprof.dll,SetSuspendState 0,1,0";
    
    public static final String COMMAND_SLEEP_COMPUTER_WIN = "cmd.exe /c rundll32 powrprof.dll,SetSuspendState Sleep";
    
    /**
     * The linux command to sleep the computer
     */
    public static final String LINUX_COMMAND_SLEEP_COMPUTER = "pm-suspend";
    
    /**
     * The MAC command to sleep the computer
     */
    //public static final String MAC_COMMAND_SLEEP_COMPUTER = "osascript -e 'tell application \"System Events\" to sleep'";
    public static final String[] MAC_COMMAND_SLEEP_COMPUTER = {"osascript", "-e", "tell application \"System Events\" to sleep"};
    
    
    /**
     * The windows command to restart the computer
     */
    public static final String COMMAND_RESTART_COMPUTER = "cmd.exe /c shutdown -r -t ";

}
